Skip to content

Add optional FixedScaleOffset dimension preservation - #853

Open
shixi-li wants to merge 1 commit into
zarr-developers:mainfrom
shixi-li:codex/keep-fixedscaleoffset-dimensions
Open

Add optional FixedScaleOffset dimension preservation#853
shixi-li wants to merge 1 commit into
zarr-developers:mainfrom
shixi-li:codex/keep-fixedscaleoffset-dimensions

Conversation

@shixi-li

Copy link
Copy Markdown

Closes #852.

Summary

  • add an opt-in keep_dimensions parameter to FixedScaleOffset, with the existing flattened output retained by default
  • preserve multidimensional shapes in both encode and decode, including logical coordinates when out uses the opposite C/F memory order
  • include the option in codec config and repr, document it in the class docstring and release notes, and retain compatibility with legacy configs

Validation

  • uv run pytest -q tests/test_fixedscaleoffset.py — 15 passed
  • uv run pytest -q — 654 passed, 32 optional-dependency skips
  • uv run ruff check src/numcodecs/fixedscaleoffset.py tests/test_fixedscaleoffset.py
  • uv run ruff format --check src/numcodecs/fixedscaleoffset.py tests/test_fixedscaleoffset.py
  • uv run mypy src/numcodecs/fixedscaleoffset.py tests/test_fixedscaleoffset.py
  • git diff --check
  • documentation build reached the updated API and release pages, but -W remains blocked by the current environment existing optional-codec imports and unrelated cross-reference warnings

Checklist

  • Unit tests and/or doctests in docstrings
  • Tests pass locally
  • Docstrings and API docs for the modified user-facing class
  • Changes documented in docs/release.md
  • Docs build locally without existing warnings
  • GitHub Actions CI passes
  • Test coverage to 100% (Codecov passes)

AI assistance

Codex assisted with test planning and independent review. I ran the tests and quality checks, inspected the final diff, and addressed a cross-memory-order out regression found during review.

@shixi-li
shixi-li marked this pull request as ready for review August 11, 2026 14:12
@shixi-li

Copy link
Copy Markdown
Author

CI/review follow-up: the four fork workflows (Tests, Wheels, i386, and Code Scanning) are all action_required and created no jobs, so no GitHub test has actually run. The PR is mergeable, the linked issue #852 remains open, and the local validation in the description is complete (654 tests passed with optional-dependency skips). Could a maintainer approve the workflows and review the opt-in compatibility change when convenient?

@d-v-b

d-v-b commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

I'll have a look today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FixedScaleOffset flattens arrays, breaking further image codecs

2 participants